import Vue from 'vue'
import Vuex from 'vuex'

import ApiService from './apiService'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    islogin: false
  },
  getters: {},
  mutations: {
      islogin(state) {
          let res = {
              cc: 0
          }
          if (res.cc === 0) {
              this.state.islogin === true;
              vueInit();
          } else {
              this.state.islogin === false;
            //   window.location.href = '/login'
          }
      },
      //登出
      changeTologout(state) {
          state.islogin = false;
      },
      //登录
      changeTologin(state) {
          state.islogin = true;
      }
  },  
  modules: {
    ApiService
  }
})

